package org.java.desgin.patterns.factory;

/**
 * method foctory 
 * 
 * @author 文强
 * 
 */
public class MethodFactory {
	public static Computer createComputer(String type) {
		Computer cpt = null;
		if ("Desktop".equals(type)) {
			cpt = new Desktop();
			cpt.setCpu("i3-380");
			cpt.setRam("2G");
		}
		if ("Notebook".equals(type)) {
			cpt = new Notebook();
			cpt.setCpu("i3-380");
			cpt.setRam("2G");
		}
		return cpt;
	}
}
